home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 359 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.2 KB

  1. Path: macshack.com!not-for-mail
  2. From: mikemc@macshack.com (Mike McCammant)
  3. Newsgroups: comp.graphics.algorithms,comp.lang.c++,comp.os.ms-windows.programmer.graphics,comp.os.ms-windows.programmer.multimedia,comp.os.ms-windows.programmer.win32
  4. Subject: Re: IJG JPEG Engine and Win32
  5. Date: 3 Jan 1996 22:09:36 -0500
  6. Organization: Mac's Shack - The "Whole Family" Internet Solution c/o macshack@randomc.com
  7. Message-ID: <4cfgdg$mhl@macshack.com>
  8. References: <4cemir$6vb@redstone.interpath.net>
  9. Reply-To: mikemc@macshack.com
  10. NNTP-Posting-Host: localhost.macshack.com
  11.  
  12. In article <4cemir$6vb@redstone.interpath.net>,
  13. Jumpstile Turner <fortunat@interpath.com> wrote:
  14. >  Hi all.  Has anyone successfully compiled and linked the IJG JPEG engine 
  15. >with a Win32 compiler?  I can compile it fine and the resulting LIB file works 
  16. >great when linking it into the included test applications; however, if I try 
  17. >to link it with my GUI apps I get some really odd errors.   It links fine but 
  18. >doesn't work! I'm using Borland C++ 4.52 (maybe this is my problem. (-: )    
  19. >Basically stepping through with the debugger there is an assignment statement 
  20. >in one of the modules that just doesn't do anything.  I mean nothing.  If I do 
  21. >the assignment by hand with the debugger it works.  For example, the 
  22. >assignment is as follows:
  23. >
  24. > cinfo->output_width = cinfo->image_width;
  25. >
  26. >cinfo->output_width is 0 and cinfo->image_width is say 289.  After the above 
  27. >assignment nothing changes.   I'm far from a c++ expert and I've never 
  28. >encountered something like this before.  If someone has compiled this lib 
  29. >under Win32 I'd appreciate it if they could mail it my way.  I'd like to see 
  30. >if its my compiler settings or just my ignorance. ;)   The big problem I can't 
  31. >figure is that the compiled lib works fine linked with the test programs.  I 
  32. >tried copying the code from the examples line for line but it just won't work 
  33. >under the GUI.
  34.  
  35. I also have the libs "working", compiled under VC++ 2.2.  There are some 
  36. weird problems, mainly with the cinfo variables not tracking right.  It is
  37. probably something dumb on my part.  I had a problem with:
  38.  
  39. if( cinfo.next_scanline < cinfo.image_height) {
  40.    blah blah...;
  41.    jpeg_write_scanlines(blah);
  42.    }
  43.  
  44. cinfo.next_scanline stays at 0.  I fixed this by adding a tracking
  45. uint variable scanline into the loop and compared it to cinfo.image_height.
  46.  
  47. scanline = 0;
  48.  
  49. while( (cinfo.next_scanline < cinfo.image_height) &&
  50.        ((unsigned int) scanline < cinfo.image_height) ) {
  51.    blah blah...;
  52.    jpeg_write_scanlines(blah);
  53.    scanline++;
  54.    }
  55.  
  56. Although this did not fix the lib, it did get my project going.
  57.  
  58. It seems that the cinfo variables do not auto-increment at all.
  59.  
  60. I was going to compile/link project with all the modules directly
  61. instead of using a static lib, that way I could debug it all
  62. easier.  Well, too much code, too little time.  Plus the project
  63. was working so why?  ;)
  64.  
  65. If you do figure out what it is, I would like to fix my libs too.
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.     
  74.  
  75. -- 
  76. Mike - mikemc@macshack.com  -  Home of the JEO-Counter, graphic WWW counter
  77.  /---------------------------------------\   My opinions belong to me, 
  78. | Visit us at http://www.macshack.com     |  myself and I, not my employer,
  79.  \......................................./   the government or my wife...:)
  80.